package javatwo;
import java.util.Arrays;
import java.util.Scanner;
public class Test {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		System.out.println("请输入选手数：");		
		int plalength=input.nextInt();
		Player player[] = new Player[plalength];
		for(int i=0;i<plalength;i++)
		{
			player[i]=new Player();
		}
		System.out.println("请输入评委人数：");
		int judgelength=input.nextInt();
		
		Score sc=new Score(judgelength);
		
		for(int i=0;i<plalength;i++)
		{
			System.out.println("请输入选手编号；");
			String planum=input.next();
			System.out.println("请输入选手姓名；");
			String planame=input.next();
			System.out.println("请为选手打分：");
			sc.inputScore();
			double a[] = sc.getScore();  
			double ave=sc.average(a); 
			System.out.println(ave);
			player[i]=new Player(planum,planame,ave);
			
		}
		
		
		Arrays.sort(player);
		for(int i=0;i<plalength;i++)
		{
			System.out.println(player[i]);
		}
	}
}
